package com.victor.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.victor.dao.NewsDao;
import com.victor.entity.News;
import com.victor.service.NewsService;

@Service
public class NewsServiceimpl implements NewsService {

	@Autowired
	private NewsDao newsDao;

	// 获取新闻列表
	@Override
	public List<News> getNewsList() {
		return newsDao.getNewsList();
	}

	// 新建新闻
	@Override
	public boolean build(News news) {
		return newsDao.build(news) > 0 ? true : false;
	}

	// 修改新闻信息
	@Override
	public boolean update(News news) {
		return newsDao.update(news) > 0 ? true : false;
	}

	// 批量删除
	@Override
	public boolean batchDelete(int[] ids) {
		return newsDao.batchDelete(ids) > 0 ? true : false;
	}
}
